package thread06;

public class Ticket implements Runnable{
	private int ticket=100;//初始化100张票
	@Override
	public void run() {
      //卖票
		while(true) {
			if(ticket>0){
				/*try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}*/
				//System.out.println(Thread.currentThread().getName()+"..."+ticket--);
				System.out.println(Thread.currentThread().getName()+"..."+ticket);
				ticket=ticket-1;
			}
		}
	}
}
